#!/usr/bin/env python3  /*设定脚本文件直接能执行*/
# -*- coding:utf-8 -*-   /*设置编码*/
"""
@Author: WANDERSON M.PIMENTA
@Software: PyCharm 、Qt Designer and PySide6
@File: tQTableWidget.py
@Time: 2024/05/11 16:35
@Function：ctQTableWidget：自定义表格
"""
from tQQtCore import *
from .tQTableWidgetStyle import *


class ctQTableWidget(QTableWidget):
    # 初始化
    def __init__(self,
                 radius=8,
                 color="#FFF",
                 bg_color="#444",
                 selection_color="#FFF",
                 header_horizontal_color="#333",
                 header_vertical_color="#444",
                 bottom_line_color="#555",
                 grid_line_color="#555",
                 scroll_bar_bg_color="#FFF",
                 scroll_bar_btn_color="#3333",
                 context_color="#00ABE8"):
        super().__init__()

        # 设置样式表
        self.__f_setStylesheet(radius, color,
                               bg_color,
                               header_horizontal_color,
                               header_vertical_color,
                               selection_color,
                               bottom_line_color,
                               grid_line_color,
                               scroll_bar_bg_color,
                               scroll_bar_btn_color,
                               context_color
                               )

    # 设置样式表
    def __f_setStylesheet(self,
                          radius,
                          color,
                          bg_color,
                          header_horizontal_color,
                          header_vertical_color,
                          selection_color, bottom_line_color,
                          grid_line_color,
                          scroll_bar_bg_color,
                          scroll_bar_btn_color,
                          context_color):
        # 应用样式表
        style_format = style.format(
            _radius=radius,
            _color=color,
            _bg_color=bg_color,
            _header_horizontal_color=header_horizontal_color,
            _header_vertical_color=header_vertical_color,
            _selection_color=selection_color,
            _bottom_line_color=bottom_line_color,
            _grid_line_color=grid_line_color,
            _scroll_bar_bg_color=scroll_bar_bg_color,
            _scroll_bar_btn_color=scroll_bar_btn_color,
            _context_color=context_color
        )
        self.setStyleSheet(style_format)
